<?php
/**
 * Project: ShopWorx- making your life easier
 *   
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @Author Chris 
 * @File logout.php
 * @Version 1.0.0
 * @Copyright 2008 Shopworx (c) 
 * @Year 2008
 * @access Public 
 */
 
 require_once "common.php";
 include_once "includes/messages/" . $DEFAULT_LANGUAGE . "_messages.php";
 
 class Logout extends Application{
	function run()
	{
		  session_destroy();
		  $this->debug("Session successfully ended.");
		  $this->debug("User successfully logged out.");
		  $this->debug("Redirect to login Page.");

		  header("location: login.php");

	}
	
    function is_authenticated()
	{
		return (!empty($_SESSION['SESSION_USERNAME'])) ? TRUE : false;
	}
 }
 
 $login = new logout(
                        array(
						      'app_name'          => 'Logout',
							  'app_version'       => '1.0.0',
							  'app_type'          => 'WEB',
							  'app_db_url'        => $DB_URL,
							  'app_auto_connect'  => true,
							  'app_auto_authorize'=> false,
							  'app_auto_chk_session' => false,
							  'app_debugger'      => $ON
							  )
                      );
 $login->buffer_debugging();
 $login->run();
 $login->dump_debuginfo();
 

